function getTree(pid = '', items: Array<object | any>) {
  var _arr: Array<object> = [];
  items.forEach(item => {
    if (pid === item.pid) {
      item.children = getTree(item.id, items);
      _arr.push(item);
    }
  });
  return _arr;
}
export default getTree